<template>
    <div>
        <div class="container-index-header bg" :style="{backgroundImage:'url('+adImage.url+')'}">
            <div style="background-color:#143f87">
                 <MainNav :logo="tree.index_logo.children"></MainNav>
            </div>
        </div>
        <div class="container">
            <AliveRouterView></AliveRouterView>
        </div>   
        <BackTop></BackTop>
        <MainFooter></MainFooter>
    </div>
</template>

<script>
import MainNav from './main-components/nav'
import MainFooter from './main-components/footer'
    export default {
        data(){
            return{
                login:true,
                register:true,
                message:0,
                theme1:'light',
                adImg:{path:'',url:''}
            }
            
        },
        methods:{

        },
        components:{MainNav,MainFooter },
        computed: {
        tree(){
            return this.$store.state.app.dicTree;
        },
        adImage(){
            if(this.tree.subpage_image.children.length != 0){
                this.adImg.url = this.tree.subpage_image.children[0].logo[0].url;
                this.adImg.path = this.tree.subpage_image.children[0].url;
            }else{
                this.adImg.path = '/index';
                this.adImg.url = require('../images/20160514132717631120058_1920.jpg');
            }
            return this.adImg;
        }

        }
    }
</script>
<style scoped>
/* 
    2018/01/08
    author:liumingyuan
*/
/* 版心样式 */
.container{
    width: 58%;
    margin: 0 auto;
    padding-bottom: 10px;
    min-width: 960px;
    padding-top: 1px;
}
.container-index-header{
    height:200px;
    position: relative;
}
.bg{
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center center;
}
</style>